/*
 * DPVS is a software load balancer (Virtual Server) based on DPDK.
 *
 * Copyright (C) 2021 iQIYI (www.iqiyi.com).
 * All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */
#ifndef __DPVS_SOCKOPTS_CONF_H__
#define __DPVS_SOCKOPTS_CONF_H__

#include <conf/common.h>

#define ENUM_ITEM(ITEM) ITEM,
#define ENUM_STRING(ITEM) #ITEM,

#define DPVSMSG_SOCKOPT_ENUM(DPVSMSG)   \
    DPVSMSG(SOCKOPT_SET_LADDR_ADD)      \
    DPVSMSG(SOCKOPT_SET_LADDR_DEL)      \
    DPVSMSG(SOCKOPT_SET_LADDR_FLUSH)    \
    DPVSMSG(SOCKOPT_GET_LADDR_GETALL)   \
    DPVSMSG(SOCKOPT_GET_LADDR_MAX)      \
    \
    DPVSMSG(DPVSAGENT_VS_GET_LADDR)     \
    DPVSMSG(DPVSAGENT_VS_ADD_LADDR)     \
    DPVSMSG(DPVSAGENT_VS_DEL_LADDR)     \
    \
    DPVSMSG(DPVS_SO_SET_FLUSH)      \
    DPVSMSG(DPVS_SO_SET_ZERO)       \
    DPVSMSG(DPVS_SO_SET_ADD)        \
    DPVSMSG(DPVS_SO_SET_EDIT)       \
    DPVSMSG(DPVS_SO_SET_DEL)        \
    DPVSMSG(DPVS_SO_SET_ADDDEST)    \
    DPVSMSG(DPVS_SO_SET_EDITDEST)   \
    DPVSMSG(DPVS_SO_SET_DELDEST)    \
    DPVSMSG(DPVS_SO_SET_GRATARP)    \
    DPVSMSG(DPVS_SO_GET_VERSION)    \
    DPVSMSG(DPVS_SO_GET_INFO)       \
    DPVSMSG(DPVS_SO_GET_SERVICES)   \
    DPVSMSG(DPVS_SO_GET_SERVICE)    \
    DPVSMSG(DPVS_SO_GET_DESTS)      \
    DPVSMSG(DPVSAGENT_SO_GET_SERVICES) \
    DPVSMSG(SOCKOPT_SVC_MAX)        \
    \
    DPVSMSG(DPVSAGENT_VS_GET_DESTS) \
    DPVSMSG(DPVSAGENT_VS_ADD_DESTS) \
    DPVSMSG(DPVSAGENT_VS_EDIT_DESTS) \
    DPVSMSG(DPVSAGENT_VS_DEL_DESTS) \
    \
    DPVSMSG(SOCKOPT_SET_ROUTE_ADD)  \
    DPVSMSG(SOCKOPT_SET_ROUTE_DEL)  \
    DPVSMSG(SOCKOPT_SET_ROUTE_SET)  \
    DPVSMSG(SOCKOPT_SET_ROUTE_FLUSH)\
    DPVSMSG(SOCKOPT_GET_ROUTE_SHOW) \
    \
    DPVSMSG(SOCKOPT_SET_ROUTE6_ADD_DEL) \
    DPVSMSG(SOCKOPT_SET_ROUTE6_FLUSH)   \
    DPVSMSG(SOCKOPT_GET_ROUTE6_SHOW)    \
    \
    DPVSMSG(DPVSAGENT_ROUTE_GET) \
    DPVSMSG(DPVSAGENT_ROUTE_ADD) \
    DPVSMSG(DPVSAGENT_ROUTE_DEL) \
    DPVSMSG(DPVSAGENT_ROUTE6_GET) \
    DPVSMSG(DPVSAGENT_ROUTE6_ADD) \
    DPVSMSG(DPVSAGENT_ROUTE6_DEL) \
    \
    DPVSMSG(DPVSAGENT_IFADDR_GET_BASE) \
    DPVSMSG(DPVSAGENT_IFADDR_GET_STATS) \
    DPVSMSG(DPVSAGENT_IFADDR_GET_VERBOSE) \
    DPVSMSG(DPVSAGENT_IFADDR_ADD) \
    DPVSMSG(DPVSAGENT_IFADDR_DEL) \
    \
    DPVSMSG(SOCKOPT_SET_IFADDR_ADD)     \
    DPVSMSG(SOCKOPT_SET_IFADDR_DEL)     \
    DPVSMSG(SOCKOPT_SET_IFADDR_SET)     \
    DPVSMSG(SOCKOPT_SET_IFADDR_FLUSH)   \
    DPVSMSG(SOCKOPT_GET_IFADDR_SHOW)    \
    DPVSMSG(SOCKOPT_GET_IFMADDR_SHOW)   \
    \
    DPVSMSG(SOCKOPT_NETIF_SET_LCORE)    \
    DPVSMSG(SOCKOPT_NETIF_SET_PORT)     \
    DPVSMSG(SOCKOPT_NETIF_SET_BOND)     \
    DPVSMSG(SOCKOPT_NETIF_SET_MAX)      \
    DPVSMSG(SOCKOPT_NETIF_GET_LCORE_MASK)   \
    DPVSMSG(SOCKOPT_NETIF_GET_LCORE_BASIC)  \
    DPVSMSG(SOCKOPT_NETIF_GET_LCORE_STATS)  \
    DPVSMSG(SOCKOPT_NETIF_GET_PORT_LIST)        \
    DPVSMSG(SOCKOPT_NETIF_GET_PORT_BASIC)       \
    DPVSMSG(SOCKOPT_NETIF_GET_PORT_STATS)       \
    DPVSMSG(SOCKOPT_NETIF_GET_PORT_XSTATS)      \
    DPVSMSG(SOCKOPT_NETIF_GET_PORT_EXT_INFO)    \
    DPVSMSG(SOCKOPT_NETIF_GET_BOND_STATUS)      \
    DPVSMSG(SOCKOPT_NETIF_GET_MADDR)\
    DPVSMSG(SOCKOPT_NETIF_GET_MAX)  \
    \
    DPVSMSG(SOCKOPT_SET_LLDP_TODO)  \
    DPVSMSG(SOCKOPT_GET_LLDP_SHOW)  \
    \
    DPVSMSG(SOCKOPT_SET_NEIGH_ADD)  \
    DPVSMSG(SOCKOPT_SET_NEIGH_DEL)  \
    DPVSMSG(SOCKOPT_GET_NEIGH_SHOW) \
    \
    DPVSMSG(SOCKOPT_SET_BLKLST_ADD) \
    DPVSMSG(SOCKOPT_SET_BLKLST_DEL) \
    DPVSMSG(SOCKOPT_SET_BLKLST_FLUSH)   \
    DPVSMSG(SOCKOPT_GET_BLKLST_GETALL)  \
    \
    DPVSMSG(SOCKOPT_SET_WHTLST_ADD) \
    DPVSMSG(SOCKOPT_SET_WHTLST_DEL) \
    DPVSMSG(SOCKOPT_SET_WHTLST_FLUSH)   \
    DPVSMSG(SOCKOPT_GET_WHTLST_GETALL)  \
    \
    DPVSMSG(SOCKOPT_SET_VLAN_ADD)   \
    DPVSMSG(SOCKOPT_SET_VLAN_DEL)   \
    DPVSMSG(SOCKOPT_GET_VLAN_SHOW)  \
    \
    DPVSMSG(SOCKOPT_TC_ADD)     \
    DPVSMSG(SOCKOPT_TC_DEL)     \
    DPVSMSG(SOCKOPT_TC_CHANGE)  \
    DPVSMSG(SOCKOPT_TC_REPLACE) \
    DPVSMSG(SOCKOPT_TC_SHOW)    \
    \
    DPVSMSG(SOCKOPT_SET_CONN)           \
    DPVSMSG(SOCKOPT_GET_CONN_ALL)       \
    DPVSMSG(SOCKOPT_GET_CONN_SPECIFIED) \
    \
    DPVSMSG(SOCKOPT_IP6_SET)    \
    DPVSMSG(SOCKOPT_IP6_STATS)  \
    \
    DPVSMSG(SOCKOPT_TUNNEL_ADD) \
    DPVSMSG(SOCKOPT_TUNNEL_DEL) \
    DPVSMSG(SOCKOPT_TUNNEL_CHANGE)  \
    DPVSMSG(SOCKOPT_TUNNEL_REPLACE) \
    DPVSMSG(SOCKOPT_TUNNEL_SHOW)    \
    \
    DPVSMSG(SOCKOPT_SET_KNI_ADD)    \
    DPVSMSG(SOCKOPT_SET_KNI_DEL)    \
    DPVSMSG(SOCKOPT_SET_KNI_FLUSH)  \
    DPVSMSG(SOCKOPT_GET_KNI_LIST)   \
    \
    DPVSMSG(SOCKOPT_SET_IPSET)      \
    DPVSMSG(SOCKOPT_GET_IPSET_TEST) \
    DPVSMSG(SOCKOPT_GET_IPSET_LIST) \
    \
    DPVSMSG(SOCKOPT_SET_IFTRAF_ADD) \
    DPVSMSG(SOCKOPT_SET_IFTRAF_DEL) \
    DPVSMSG(SOCKOPT_GET_IFTRAF_SHOW)\

typedef enum {
    DPVSMSG_SOCKOPT_ENUM(ENUM_ITEM)
}SOCKOPT_CODE;

#define SOCKOPT_LADDR_BASE     SOCKOPT_SET_LADDR_ADD
#define SOCKOPT_SVC_BASE         DPVS_SO_SET_FLUSH
#define SOCKOPT_SVC_GET_CMD_MAX  SOCKOPT_SVC_MAX
#define SOCKOPT_SVC_SET_CMD_MAX  SOCKOPT_SVC_MAX

#endif /* __DPVS_SOCKOPTS_CONF_H__ */
